
<!doctype html>
<html class="no-js" lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title>登陆界面</title>
		<link rel="stylesheet" href="js/bootstrap.css" />
		<script src="js/jquery.min.js"></script>
		<script src="js/bootstrap.js"></script>
		<script type="text/javascript">
		$(function(){
			//登陆的表单提交
			$("#form-horizontal").submit(function(){
				var userName = $("#uesrName").val(); 
				var passWord = $("#passWord").val();
				if(uesrName=="" || passWord == ""){
					alert("用户名或者密码不能为空！");
					return ;
				}
				$.ajax({
					url:"login",
					data:{
						"userName":userName,
						"passWord":passWord
					},
					type:"post",
					success:function(data){
						console.log(data);
						if(data.code=="1001"){
							alert(data.message);
						}else{
							sessionStorage.setItem("account",JSON.stringify(data.account));
							window.location.href="index.html";
						}	
					}
				});
				return false;
			});
		});
		</script>
	</head>
	<body>
	<div style="width: 1000px; margin: 100px auto;">
		<form class="form-horizontal" id="form-horizontal">
		  <div class="form-group">
			<label for="inputEmail3" class="col-sm-2 control-label">用户名</label>
			<div class="col-sm-10">
			  <input type="text" style="width: 500px;" class="form-control" id="uesrName" placeholder="请输入用户名">
			</div>
		  </div>
		  <div class="form-group">
			<label for="inputPassword3" class="col-sm-2 control-label">密码</label>
			<div class="col-sm-10">
			  <input type="password" style="width: 500px;" class="form-control" id="passWord" placeholder="请输入密码">
			</div>
		  </div>
		  <div class="form-group">
			<div class="col-sm-offset-2 col-sm-10">
			  <button type="submit" class="btn btn-default">登入</button>
			  <button type="reset" class="btn btn-default">重置</button>
			</div>
		  </div>
		</form>
	</div>
	</body>
</html>

<!-- 这是wpz分支的内容1 -->











<!--div分支的内容  -->

